﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ANGFLib;

namespace ANGF
{
    public partial class FormEditTempTalker : Form
    {
        public FormEditTempTalker()
        {
            InitializeComponent();
        }

        private void buttonInsert_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(textBox1.Text))
            {
                MessageBox.Show(this, "名前を入力してください。",this.Text);
                return;
            }
            if (textBox1.Text.Any(c => Char.IsWhiteSpace(c)))
            {
                MessageBox.Show(this, "名前に空白文字を含めることはできません。", this.Text);
                return;
            }
            if (string.IsNullOrWhiteSpace(comboBoxShortName.Text))
            {
                MessageBox.Show(this, "短い名前を入力してください。", this.Text);
                return;
            }
            if (comboBoxShortName.Text.Any(c => Char.IsWhiteSpace(c)))
            {
                MessageBox.Show(this, "短い名前に空白文字を含めることはできません。", this.Text);
                return;
            }
            DialogResult = DialogResult.OK;
            Close();
        }

        private void FormEditTempTalker_Load(object sender, EventArgs e)
        {
            radioButton1.Checked = true;
            comboBoxShortName.Items.Clear();
            for (char i = 'a'; i <= 'z'; i++)
            {
                comboBoxShortName.Items.Add(i);
            }
            comboBoxShortName.SelectedIndex = 0;
        }

        public string GetResultText()
        {
            string sex = "MALE";
            if (radioButton2.Checked) sex = "FEMALE";
            if (radioButton3.Checked) sex = "NUTRAL";
            if (radioButton4.Checked) sex = "SHEMALE";
            return "#P " + comboBoxShortName.Text + " " + sex + " " + textBox1.Text + "\r\n";
        }
    }
}
